<%@ page import="weaver.general.Util" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="bb" class="weaver.general.BaseBean"/>
<jsp:useBean id="rs1" class="weaver.conn.RecordSet"/>
<%
    String json = "{\"flag\":\"0\"}";
    String mbjson = "";
    String mzwxid = Util.null2String(request.getParameter("mzwxid"));
    String wxworkflowid = Util.null2String(request.getParameter("wxworkflowid"));
    String maintable = "";
    String dt1table = "";
    if("105".equals(wxworkflowid)){//维修封测
        maintable = "formtable_main_179";
        dt1table = "formtable_main_179_dt1";
    }else if("104".equals(wxworkflowid)){//模组维修
        maintable = "formtable_main_175";
        dt1table = "formtable_main_175_dt1";
    }
        rs.executeQuery("select id from "+maintable+" where requestid='"+mzwxid+"'");
        rs.next();
        String mainid  = Util.null2String(rs.getString("id"));
        rs1.executeQuery("select sapcode,quantity1,Photo from "+dt1table+" where mainid='"+mainid+"'");
        while (rs1.next()){
            String sapcode  = Util.null2String(rs1.getString("sapcode"));
            String quantity1  = Util.null2String(rs1.getString("quantity1"));
            String Photo  = Util.null2String(rs1.getString("Photo"));
            String str ="{\"sapcode\":\"" + sapcode + "\",\"quantity1\":\"" + quantity1 + "\",\"Photo\":\"" + Photo + "\"}";
            if("".equals(mbjson)){
                mbjson = str;
            }else{
                mbjson += ","+str;
            }
        }
    if (!"".equals(mbjson)) {
        json="{\"flag\":\"1\",\"mb\":["+mbjson+"]}";
    }
    out.print(json);
%>

